package com.suneee.permission.dao;

import java.util.List;

import com.suneee.orm.Dao;
import com.suneee.permission.bean.PermissionDto;
import com.suneee.permission.entity.Permission;

public interface PermissionDao extends Dao<Permission, Integer> {
	
	/**
	 * 获得所有权限
	 * @param enterpriseCode
	 * @return
	 */
	public List<Permission> permissionList(PermissionDto dto);
	
	/**
	 * 获得所有权限
	 * @param enterpriseCode
	 * @return
	 */
	public List<Permission> permissionNewList(int len,String parentCode,String groupName);
	
	/**
	 * 角色尚未授权的权限
	 * @param roleId
	 * @param enterpriseCode
	 * @return
	 */
	public List<Permission> notUsedPermissionList(Integer roleId,String enterpriseCode);
	
	/**
	 * 获得默认公共权限
	 * @param group
	 * @return
	 */
	public List<Permission> publicPermissions(String group);
	
	/**
	 * 判断菜单名称是否重复
	 * @param permission
	 * @return
	 */
	public boolean isExitsMenuName(Permission permission);
	
	/**
	 * 判断菜单名称是否重复
	 * @param permission
	 * @return
	 */
	public boolean isExitsUrl(Permission permission);
	
	
	/**
	 * 判断菜单名称是否重复 -修改
	 * @param permission
	 * @return
	 */
	public boolean isExitsUpdateName(Permission permission);
	
	/**
	 * 判断菜单下是否还有子菜单
	 * @param permission
	 * @return
	 */
	public boolean isExitsChildMenu(Integer permissionId,String code);
	
	/**
	 * 获取最大code 
	 * @param codeLen
	 * @return
	 */
	public String getMaxCode(int codeLen ,String parentcode);
	
	/**
	 * 启用/禁用   
	 * enable  1:启用,0:禁用
	 * code 权限编码
	 * @param permissionId
	 */
	public void enable(Permission permission);

}
